//
//  world.h
//  SSE
//
//  Created by Matt Roman on 10/2/07.
//  Copyright 2007 OU IRL. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "openGLheads.h"
#import "Crate.h"
#import "Cspace.h"

#ifndef MFUNS_H
#define MFUNS_H
#include "Mfuns.h"
#endif

///////////////////////////////////////////////////////////////////
// WORLD SETUP
#define NUMOBS			60
#define WORLDX			30
#define WORLDY			30
#define STARTX			0.0
#define STARTY			0.0
#define GOALX			30.0
#define GOALY			30.0

#define MAXL			2.0
#define MAXW			5.25
#define MAXH			0.25
#define GOALSIZE		0.2
#define GOALHEIGHT		5.0
#define GOALTHRESH		2.5
#define CSPACE			0.4		// should be equal to the radius of the robot
#define OBSTACLERADIUS	sqrt((MAXL+CSPACE)*(MAXL+CSPACE) + (MAXW+CSPACE)*(MAXW+CSPACE))/2


@interface world : NSObject {
	int		numObstacles;
	int		worldNumber;
	GLfloat wind;
	Point3f goal;
	double	coverageArea;
	
	NSMutableArray *obstacles;		// array of Crate objects
	NSMutableArray *configSpace;	// array of Cspace objects
}

- (id)initWorldWithGoal:(Point3f)g;
// draws a grid line at 5m increments
- (void) DrawGrid;
// draws the goal at x y coords.
- (void) GlobalGoal;
// draws the obstacles
- (void) DrawWorldObstacles:(BOOL)obst Cspace:(BOOL)cspace;
- (void) ResetObstacles;
- (double) getCoverageArea;
- (int) getNumberOfCspaceObjs;
- (NSMutableArray *)getConfigurationArray;
- (int) getWorldNum;
- (void) WorldCountReset;
- (int) numObstacles;
- (void) setNumObstacles:(int)n;
@end
